/**
 * Created by chenliang on 2017/3/22.
 */

var logginRespon = {};

function defaultLoginrespon() {
    /*
     #ifdef Formal_Environment
     self.loginRsp.apiSignCode = @"dcb3fc92";
     self.loginRsp.apiUserName = @"55507e8245ce310395d63a40";
     self.loginRsp.userKey = @"55507e8245ce310395d63a41";
     self.strUserName = @"guest";
     #else
     self.loginRsp.apiSignCode = @"5f573098";
     self.loginRsp.apiUserName = @"552734bfe4b020e21058e697";
     self.loginRsp.userKey = @"552734bfe4b020e21058e698";
     self.strUserName = @"niming";
     #endif
     */
    logginRespon.username = "niming";
    logginRespon.apiSignCode = "5f573098";
    logginRespon.apiUserName = "552734bfe4b020e21058e697"
    logginRespon.userKey = "552734bfe4b020e21058e698";
    logginRespon.contactMobile = ""
    logginRespon.contactUserName = ""

    return logginRespon;
}

/* 获取用户名 */
function apiuserName() {
    return '5897d40be4b0d75542c7e53b';
}

/* 获取signcode */
function signCode() {
//    return "5f573098";
    return "1be3001a";
}

/* 获取appType */
function appType() {
    return "tdx";
}

/* 获取operatorKey */
function operatorKey() {
    // return "5897d40be4b0d75542c7e53c";
    return "5897d40be4b0d75542c7e53c";
}

function requestMataInfo() {
    var strCode = "tzOpenapisignCode";
    strCode = strCode + defaultLoginrespon().apiSignCode;
    strCode = strCode + "timeStamp"
    strCode = strCode + norTimeStamp();
    strCode = strCode + "userName";
    strCode = strCode + defaultLoginrespon().apiUserName;
    strCode = strCode + "tzOpenapi";
    return strCode;
}

/* 获取时间戳 */
function norTimeStamp() {
    var timestamp = Date.parse(new Date())/1000;
    return timestamp;
}

/* 请求data实体类封装 */
function requestData() {
    var data = {};
    data.userName = defaultLoginrespon().apiUserName;
    data.signCode = $.md5(requestMataInfo());
    data.timeStamp = norTimeStamp();
    data.requestID = norTimeStamp() + "ld_bycapp_ios";
    data.appType = appType();
    data.operatorKey = defaultLoginrespon().userKey;
    data.responseDataType = "JSON";
    return data;
}